export default {
    props:['menuData', 'firstItem'],

    data() {
        console.log(this.menuData)
        return {
            currentTab: this.firstItem
        }
    },

    computed: {
        tabs() {
            return Object.keys(this.menuData)
        },
        lists() {
            return this.menuData[this.currentTab]
        }
    },

    handleTabClick(currentTab) {
        this.currentTab = currentTab
    },

    onReady() {
        this.$watch('firstItem',(newValue) => {
            this.currentTab = newValue
        })
    }
}